package day01

object VarDemo {
  def main(args: Array[String]): Unit = {

    var a: Int = 10
    //  a = "hello"
    a = 100

    val b: Int = 20
    // b =  25

    println("我打印的内容为: " + a)
    println("我打印的内容为: " + b)

    println("=================================>")

    val a1: Byte = 127

    val a4 = 12345667788L
    println("我具体的值为:" + a1)
    println("我具体的值为:" + a4)

    val a3 = 1989988989
    var typeInfo =  checkType(a3)
    println( "我的类型为: " + typeInfo)

    val x: Any = "Hello, Scala!"
    typeInfo = checkType(x)
    println( "我的类型为: " + typeInfo)

    val f1 = 1.2356f
    val d3 = 34.2234
    typeInfo =  checkType(d3)
    println( "我的类型为: " + typeInfo)
  }

  def checkType(x: Any): String = x match {
    case _: String => "String"
    case _: Int => "Int"
    case _: Double => "Double"
    case _: Float => "Float"
    case _: Character => "Character"
    case _: Boolean => "Boolean"
    case _: List[_] => "List"
    case _ => "Unknown"
  }

}

